package builder.banks;

import builder.AbstractOperations;
import builder.BankDataModel;
import builder.OperationNotAllowedException;

/**
 * Created by Vyacheslav on 04.07.2014.
 */
public class UkrEximBankOperations implements AbstractOperations {

    private String bankPhone = "729";

    @Override
    public String getBalance(BankDataModel model) {
        return new StringBuilder().append(model.getCardNumber().substring(0,3)).append("%").append(model.getCardNumber().substring(12,15)).append("_").append(01).toString();
    }

    @Override
    public String blockCard(BankDataModel model) {
        return new StringBuilder().append(model.getCardNumber().substring(0,3)).append("%").append(model.getCardNumber().substring(12,15)).append("_").append(99).toString();
    }

    @Override
    public String getReport(BankDataModel model) {
        return new StringBuilder().append(model.getCardNumber().substring(0,3)).append("%").append(model.getCardNumber().substring(12,15)).append("_").append(02).toString();
    }

    @Override
    public String moneyTransfer(BankDataModel model) {
        throw new OperationNotAllowedException();
    }

    @Override
    public String unblockCard(BankDataModel model) {
        throw new OperationNotAllowedException();
    }

    @Override
    public String mobileTransfer(BankDataModel model) {
        throw new OperationNotAllowedException();
    }

    @Override
    public String getBankPhone() {
        return bankPhone;
    }
}
